#ifndef __MONDE_H__
#define __MONDE_H__ 

#include <SDL.h>
#include <vector>

#include "Global.h"
#include "Affichage.h"
#include "Carte.h"
#include "Collision.h"
#include "Facade.h"

using namespace std;

class Monde 
{
	public:
		Monde( Affichage &oAffichage );
		void init( Facade &oFacade );

		bool chargerMonde(string nomFichier);
		bool chargerCarte(string nomFichier);
		void draw(int camX, int camY, TypeLayer layer );

		void Deplacement( TInfoLink& infoLink );
		void gererCollisionLimitesMonde( TInfoLink& infoLink );
		void gererCollisionDansLeMonde( TInfoLink& infoLink );
		
		TypeTuile getTypeTuile( int x, int y, SDL_Rect& recCol );
		TypeObjet getTypeObjet( int x, int y );
		TypeObjet getTypeObjet( int x, int y, TRecCol& recCol );

		TypeObjet soulever( int x, int y, TRecCol& recCol );
		void allumerTorche( int x, int y );

		int getLargMondePixel();
		int getHautMondePixel();
		int getLargMonde();
		int getHautMonde();
		int getLargCarte();
		int getHautCarte();

		~Monde();

	private:
		int getMapID(int camX, int camY);
		void nettoyer();

		static const int MAX_TUILES = 50;
		enum TypeMonde { T_NONE = 11, T_CARTE = 22, T_MONDE = 33 };

		bool bMondeChargee;
		TypeMonde type;

		vector<Carte*> lstCarte;

		int largMonde , hautMonde;
		int largMondePixel, hautMondePixel;

		SDL_Surface* Surf_Tileset;

		Affichage& oAffichage;
		Collision* oCollision;
};

#endif //__MONDE_H__

